﻿<UserControl x:Class="ConfigEditor.View.UserCtrlOtherSettings"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <DataGrid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" 
                  Name="dtgrid"
                  ItemsSource="{Binding Path=SettingsView}"
                  AlternatingRowBackground="LightCyan">
            <DataGrid.RowStyle>
                <Style TargetType="DataGridRow">
                    <Setter Property="IsSelected" Value="{Binding Path=IsSelected}" />
                </Style>
            </DataGrid.RowStyle>
            <DataGrid.Columns>
                <DataGridTextColumn Header="Key" IsReadOnly="True" 
                                                Binding="{Binding Path=Key}"
                                                MinWidth="50"></DataGridTextColumn>
                <DataGridTextColumn Header="Value" 
                                                Binding="{Binding Path=Value}"
                                                Width="*"></DataGridTextColumn>
            </DataGrid.Columns>
        </DataGrid>
        <Button Grid.Row="1" Grid.Column="1" Content="Add"
                Command="{Binding Path=AddCmd}"/>
        <Button Grid.Row="1" Grid.Column="2" Content="Remove"
                Command="{Binding Path=RemoveCmd}"
                CommandParameter="{Binding ElementName=dtgrid,Path=SelectedItems}"/>
    </Grid>
</UserControl>
